<template>
  <view>
    <view
      class="d-flex j-start flex-column main-bg-color"
      style="height: 330rpx; position: relative"
    >
      <img
        src="/static/icon/icon4.png"
        class="msg_icon"
        @tap="msgInfo"
        alt=""
      />
      <view
        class="mt-3 d-flex a-center"
        style="padding: 0 0 0 30rpx"
        @tap="myupdat"
      >
        <image
          src="../../static/image/sheshi3.png"
          mode="widthFix"
          style="width: 30rpx; height: 30rpx"
        ></image>
        <view class="font" style="color: #a9b4ff; padding: 0 0 0 20rpx">
          单位名称
        </view>
      </view>
      <view
        class="mt-1 d-flex j-sb"
        style="padding: 0 0 0 30rpx; font-size: 32rpx"
        @tap="myupdat"
      >
        <view class="font" style="color: #fff; padding: 0 0 0 20rpx">
          {{ user_list.deptName }}
        </view>
        <image
          @tap="myupdat"
          src="../../static/image/jiantouyou.png"
          mode="widthFix"
          style="width: 30rpx; height: 30rpx; margin-right: 30rpx"
        ></image>
      </view>
      <view class="mt-1 d-flex a-center" style="padding: 0 0 0 30rpx">
        <image
          src="../../static/image/sheshi4.png"
          mode="widthFix"
          style="width: 30rpx; height: 30rpx"
        ></image>
        <view class="font" style="color: #a9b4ff; padding: 0 0 0 20rpx">
          {{ user_list.phonenumber }}
        </view>
      </view>
      <view class="mt-1 d-flex a-center" style="padding: 0 0 0 30rpx">
        <image
          src="../../static/image/sheshi2.png"
          mode="widthFix"
          style="width: 30rpx; height: 30rpx"
        ></image>
        <view class="font" style="color: #a9b4ff; padding: 0 0 0 20rpx">
          {{
            user_list.deptAddress == null || "" ? "暂无" : user_list.deptAddress
          }}
        </view>
      </view>
      <view class="mt-1 d-flex a-center" style="padding: 0 0 0 30rpx">
        <image
          src="../../static/image/my2.png"
          mode="widthFix"
          style="width: 30rpx; height: 30rpx"
        ></image>
        <view class="font" style="color: #a9b4ff; padding: 0 0 0 20rpx">
          渠道商:<text style="margin-left: 20rpx">{{
            user_list.distributorName
          }}</text>
        </view>
      </view>
    </view>
    <!-- <button  open-type="contact" ></button> -->

    <view
      class="d-flex flex-column pb-4 pt-5 border-bottom"
      style="width: 90%; margin: 0 auto"
      @tap="jumpUserList"
    >
      <view class="d-flex a-center">
        <image
          src="../../static/icon/icon5.png"
          mode="widthFix"
          style="width: 44rpx; height: 44rpx; padding: 0 30rpx 0 0"
        ></image>
        <view class="font" style="color: #474747"> 工单中心 </view>
        <image
          src="../../static/image/jiantouyou.png"
          mode="widthFix"
          style="width: 18rpx; height: 18rpx; position: relative; left: 70%"
        ></image>
      </view>
    </view>
    <button
      open-type="contact"
      class="d-flex flex-column pb-4 pt-5 border-bottom"
      style="width: 90%; margin: 0 auto"
    >
      <view class="d-flex a-center">
        <image
          src="../../static/image/my1.png"
          mode="widthFix"
          style="width: 44rpx; height: 44rpx; padding: 0 30rpx 0 0"
        ></image>
        <view class="font" style="color: #474747"> 联系客服 </view>
        <image
          src="../../static/image/jiantouyou.png"
          mode="widthFix"
          style="width: 18rpx; height: 18rpx; position: relative; left: 70%"
        ></image>
      </view>
    </button>

    <view
      class="d-flex flex-column pb-4 pt-5 border-bottom"
      style="width: 90%; margin: 0 auto"
      @tap="toUS"
    >
      <view class="d-flex a-center">
        <image
          src="../../static/image/my.png"
          mode="widthFix"
          style="width: 44rpx; height: 44rpx; padding: 0 30rpx 0 0"
        ></image>
        <view class="font" style="color: #474747"> 关于我们 </view>
        <image
          src="../../static/image/jiantouyou.png"
          mode="widthFix"
          style="width: 18rpx; height: 18rpx; position: relative; left: 70%"
        ></image>
      </view>
    </view>
    <tab-bar :select="2"></tab-bar>
  </view>
</template>

<script>
export default {
  data() {
    return {
      user_list: {},
    };
  },
  onLoad() {
    //获取个人信息
    this.getuser_info();
  },

  methods: {
    //工单列表
    jumpUserList() {
      uni.navigateTo({
        url: "../user_list/user_list",
      });
    },
    //消息中心
    msgInfo() {
      uni.navigateTo({
        url: "../news/news",
      });
    },
    //获取个人信息
    getuser_info() {
      let that = this;
      if (uni.getStorageSync("token")) {
        that.$https
          .get("getMaintainUserInfo/", {
            Authorization: uni.getStorageSync("token"),
          })
          .then((res) => {
            that.user_list = res.user;
          });
      } else {
        uni.showToast({
          title: "请登录",
          icon: "none",
        });
      }
    },
    //关于我们
    toUS() {
      uni.navigateTo({
        url: "./About_us",
      });
    },
    //修改个人信息
    myupdat() {
      uni.navigateTo({
        url: "./my_update",
      });
    },
  },
};
</script>

<style lang="scss">
.msg_icon {
  width: 44rpx;
  height: 44rpx;
  position: absolute;
  right: 30rpx;
  bottom: 38rpx;
  z-index: 99;
}

button::after {
  border: none;
}

button {
  position: relative;
  display: block;
  margin-left: auto;
  margin-right: auto;
  padding-left: 0px;
  padding-right: 0px;
  box-sizing: border-box;
  // font-size: 18px;
  text-align: center;
  text-decoration: none;
  // line-height: 1;
  line-height: 1.35;
  // border-radius: 5px;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  color: #000000;
  background-color: #fff;
  width: 100%;
  height: 100%;
}
</style>
